﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace App.Account.Services
{
    public interface IAccountServiceChannel : IAccountService, System.ServiceModel.IClientChannel
    {
    }

    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class AccountServiceClient : ClientBase<IAccountService>, IAccountService, IDisposable
    {


        void IDisposable.Dispose()
        {
            if (this.State == CommunicationState.Faulted)
            {
                this.Abort();
            }
            else
            {
                this.Close();
            }
        }


        public App.Account.Models.User GetUser(Guid ID)
        {
            return base.Channel.GetUser(ID);
        }


        public App.Utility.Services.ServiceResponse<App.Account.Models.User> GetUserByName(string UserName)
        {
            return base.Channel.GetUserByName(UserName);
        }

        public App.Utility.Paging.PageResponse<App.Account.Models.User> GetUserPage(App.Utility.Paging.PageRequest PageRequest)
        {
            return base.Channel.GetUserPage(PageRequest);
        }

        public App.Utility.Paging.PageResponse<App.Account.Models.Role> GetRolePage(App.Utility.Paging.PageRequest PageRequest)
        {
            return base.Channel.GetRolePage(PageRequest);
        }

        public void SaveUser(App.Account.Models.User user)
        {
            base.Channel.SaveUser(user);
        }

        public void DeleteUser(App.Account.Models.User user)
        {
            base.Channel.DeleteUser(user);
        }

        public App.Utility.Services.ServiceResponse AttemptChangePassword(App.Account.Models.Forms.ChangePassword Form)
        {
            return base.Channel.AttemptChangePassword(Form);
        }

        public App.Utility.Services.ServiceResponse<App.Account.Models.User> AttemptLogin(App.Account.Models.Forms.Login Form)
        {
            return base.Channel.AttemptLogin(Form);
        }

        public App.Utility.Services.ServiceResponse<App.Account.Models.User> AttemptRegister(App.Account.Models.Forms.Register Form)
        {
            return base.Channel.AttemptRegister(Form);
        }


        public App.Utility.Services.ServiceResponse<App.Account.Models.User> AttemptUserEdit(App.Account.Models.Forms.UserForm Form)
        {
            return base.Channel.AttemptUserEdit(Form);
        }



        public App.Account.Models.Role GetRole(Guid ID)
        {
            return base.Channel.GetRole(ID);
        }

        public void DeleteRole(App.Account.Models.Role role)
        {
            base.Channel.DeleteRole(role);
        }


        public void SaveRole(App.Account.Models.Role role)
        {
            base.Channel.SaveRole(role);
        }

        public App.Utility.Services.ServiceResponse<App.Account.Models.Role> AttemptRoleEdit(App.Account.Models.Forms.RoleForm Form)
        {
            return base.Channel.AttemptRoleEdit(Form);
        }


        public App.Utility.Services.ServiceResponse<App.Account.Models.Role> GetRoleByName(string RoleName)
        {
            return base.Channel.GetRoleByName(RoleName);
        }

    }
}
